<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.ArrayList,
                 com.scalar.chiptrack.users.User,
                 com.scalar.chiptrack.users.Functionality,
                 com.scalar.chiptrack.users.dao.UserDAO,
                 com.scalar.chiptrack.utils.ConfigManager"%>
<%@ page import="com.scalar.chiptrack.commons.Constants" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/maintainUser.do"/>
<html:html locale="true">

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>
<%request.setAttribute("groupList",UserDAO.loadAllUserGroups());  %>
<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<script language='javascript'>
function search() {

	  var pa = document.getElementById("errors");
		var d = new Date();
		var day = d.getDate();
		var month = d.getMonth()+1;
		var year = d.getFullYear();
		var hour = d.getHours();
		var min = d.getMinutes();
		var sec = d.getSeconds();
		 var today = month + "/" + day + "/" + year;

		 var defaultPrompt = month +"/" + day + "/" + year + ":" + hour + ":" + min + ":" + sec;

	if(document.userReport.firstName.value =='')
        document.userReport.prompt0.value ='';
    else
	    document.userReport.prompt0.value = document.userReport.firstName.value+'%';
	if(document.userReport.lastName.value =='')
        document.userReport.prompt1.value ='';
    else
        document.userReport.prompt1.value = document.userReport.lastName.value+'%';
	document.userReport.prompt2.value=document.userReport.groupName.value;
	document.userReport.prompt3.value=defaultPrompt;
	/*document.userReport.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=user/user_profile.rpt";*/
    document.userReport.action="<%=chipTracContext%>/reports/userReport.do?<%=Constants.REQUEST_PARAM_REPORT_NAME%>=user/user_profile";
	document.userReport.submit();
}
</script>
</HEAD>
<BODY bgColor='#ffffff' leftMargin='0' topMargin='0' marginheight="0" marginwidth="0">

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->
<%@ include file="/jsp/admin/admin_menu.jsp" %>
<!-- end of the side navigations -->

<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>

<!-- from here your body starts -->

<html:form name="userReport" type="com.scalar.chiptrack.users.forms.MaintainUserForm" action="/maintainUser" onsubmit="return false;">
<center><span class="NArialW">User Reports</span></center>
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>
<table border="0" width="90%" align=right>
 <tr><td>

<chiptrack:errors styleClass='NArialL' />
<chiptrack:info styleClass='NArialL' />

 <table border="0" width="100%" align=right>
    <tr><td colsapn=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
	<tr>
      <td width="15%"><font class="NArialL">First Name</font></td>
      <td width="20%"><input type="text" name="firstName" size="25" maxlength="25" class="txfield"></td>
      <td width="15%"><font class="NArialL">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Last Name</font></td>
      <td width="20%"><input type="text" name="lastName" size="25" maxlength="25" class="txfield"></td>
      <td width="10%"><font class="NArialL"></font></td>
    <tr>
    </tr>
      <td width="13%"><font class="NArialL">Group</font></td>
      <td width="10%"><font class="NArialL">
            <html:select property="groupName" styleClass="txfield">
                <html:option value="">Select group Name</html:option>
                <html:options collection="groupList" property="name"/>
            </html:select>
    </td>
    </tr>
    <tr><td colsapn=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
    <tr>
            <td width="15%"></td>
            <td width="10%" align="right">
            <a href="javascript:search()">
                <img border="0" src="<%=chipTracContext%>/jsp/includes/images/submit.gif" width="53" height="17" onMouseOver="window.status='Click to Generate User Report';return true" onMouseout="window.status='';return true" title="Click here to Generate User Report">
            </a>
       </td>
    </tr>
  </table>
  </td></tr>
  <tr><td><img height=10 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td></tr><tr><td>


</td></tr>
</table>
<input type="hidden" name="prompt0">
<input type="hidden" name="prompt1">
<input type="hidden" name="prompt2">
<input type="hidden" name="prompt3">
</html:form>

<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</body>

</html:html>